package br.com.carrosvale.model.persistence;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import br.com.carrosvale.model.entity.UsuarioPF;

@Repository
public class UsuarioPFRepository extends BaseRepository<UsuarioPF>  {
	
	public UsuarioPF buscarPorEmail( String email ){
		return (UsuarioPF) createCriteria().add(Restrictions.eq("email",email).ignoreCase() ).uniqueResult();
	}
	
	@Autowired
	public void init(SessionFactory factory) {
	    setSessionFactory(factory);
	}

}